Ultimate SEO
By e$cRi  es-cri@hotmail.com      (http://www.pedroescribano.com)


1)
Subir los siguientes archivos

    * seo.class.php        -->   includes/classes/seo.class.php
    * reset_seo_cache.php  -->   admin/includes/reset_seo_cache.php



2)
Ir al archivo admin/categories.php

Localizar esta linea:
	
	$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

Aadir despues lo siguiente:

	// Ultimate SEO URLs BEGIN
	// If the action will affect the cache entries
    	if (eregi("(insert|update|setflag)", $action))
        include_once ('includes/reset_seo_cache.php');
	// Ultimate SEO URLs END



3)
Ir al archivo includes/application_top.php

Localizar esta linea:

	// include the language translations
  	require(DIR_WS_LANGUAGES . $language . '.php');

Aadir despues lo siguiente:

	// Ultimate SEO URLs v2.1
    	if (SEO_ENABLED == 'true' or (SEO_ENABLED != 'true' and SEO_ENABLED != 'false')) {
    		include_once(DIR_WS_CLASSES . 'seo.class.php');
    		if ( !is_object($seo_urls) ) {
      		$seo_urls = new SEO_URL($languages_id);
    		}
  	}
	// EOF SEO



4)
Ir al archivo includes/functions/html_output.php

Localizar esta funcion:

	// The HTML href link wrapper function
  	function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
    		global $request_type, $session_started, $SID;

Reemplazar toda la funcion por lo siguiente:

	if (SEO_ENABLED == 'true') {
    	////
	// Ultimate SEO URLs v2.1
	// The HTML href link wrapper function
  		function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
        		global $seo_urls;                
                	if ( !is_object($seo_urls) ){
                        if ( !class_exists('SEO_URL') ){
                                include_once(DIR_WS_CLASSES . 'seo.class.php');
                        }
                        global $languages_id;
                        $seo_urls = new SEO_URL($languages_id);
                	}
        		return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);
  		}
  	} else {
 	////
	// The HTML href link wrapper function
  		function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
    			global $request_type, $session_started, $SID;

		    if (!tep_not_null($page)) {
      			die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
    		    }

    		   if ($connection == 'NONSSL') {
      		$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    		   } elseif ($connection == 'SSL') {
      		if (ENABLE_SSL == true) {
        			$link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
      		} else {
        		$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
      	      }
    		   } else {
      		die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
    		   }

    		   if (tep_not_null($parameters)) {
      		$link .= $page . '?' . tep_output_string($parameters);
      		$separator = '&';
    		   } else {
      	   $link .= $page;
      	   $separator = '?';
    		}

    		while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

		// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    			if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
      		if (tep_not_null($SID)) {
        			$_sid = $SID;
      		} elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
        		if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
          		$_sid = tep_session_name() . '=' . tep_session_id();
        		}
         	}
    	}

    	if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
      	while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);

      	$link = str_replace('?', '/', $link);
      	$link = str_replace('&', '/', $link);
      	$link = str_replace('=', '/', $link);

      	$separator = '?';
    	}

    	if (isset($_sid)) {
      	$link .= $separator . $_sid;
    	}

    	return $link;
  	}
  }



5)
Ir al archivo admin/includes/functions/general.php

Aadir antes del tag final ?> lo siguiente:

	// Function to reset SEO URLs database cache entries 
	// Ultimate SEO URLs v2.1
	function tep_reset_cache_data_seo_urls($action){        
        switch ($action){
                case 'reset':
                        tep_db_query("DELETE FROM cache WHERE cache_name LIKE '%seo_urls%'");
                        tep_db_query("UPDATE configuration SET configuration_value='false' WHERE configuration_key='SEO_URLS_CACHE_RESET'");
                        break;
                default:
                        break;
        }
        # The return value is used to set the value upon viewing
        # It's NOT returining a false to indicate failure!!
        return 'false';
	}



6)
Ir al archivo .htaccess de nuestro directorio catalogo

Dos posibles casos:

a)Aadir lo siguiente si tu tienda est colgando del directorio raiz (www.dominio.com):


	Options +FollowSymLinks
	RewriteEngine On 
	RewriteBase /

	RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}


b)Aadir lo siguiente si tu tienda est colgando de una carpeta NO raiz (www.dominio.com/tienda):

	Options +FollowSymLinks
	RewriteEngine On 
	RewriteBase /tienda/

	RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
	RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}



7)
Visita www.dominio.com/admin

Ir a Configuracin->SEO URLs, clicar sobre "Enter special character conversions" y editarlo con esto:

      =>a,=>e,=>i,=>o,=>u,=>a,=>e,=>i,=>o,=>u,=>n,=>n
      

8)Se acab




